﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Kunde/WebsiteCustomer.Master" AutoEventWireup="true" CodeBehind="Bildata.aspx.cs" Inherits="TireService.Website.Kunde.Bildata" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">

<!-- Modal popup when waiting on server postback -->
<script src="../Scripts/ModalPopup.js" type="text/javascript"></script>

<h3>Bildata</h3>
    
    <asp:UpdatePanel ID="upEditCardata" runat="server">
        <ContentTemplate>

            <dxwgv:ASPxGridView ID="gvCar" runat="server" ClientInstanceName="gvCar" 
                KeyFieldName="CarId" AutoGenerateColumns="False" EnableCallBacks="False" 
                oncustomunboundcolumndata="gvCar_CustomUnboundColumnData"
                oncustombuttoncallback="gvCar_CustomButtonCallback">
                <SettingsLoadingPanel Text="Henter&amp;hellip;" />
                <SettingsText EmptyDataRow="Ingen biler" />
                <SettingsPager AlwaysShowPager="False" PageSize="10" Position="Bottom">
                    <Summary 
                        AllPagesText="Sider: {0} - {1} ({2} biler)" 
                        Text="Side {0} af {1} ({2} biler)" />
                </SettingsPager>
                <SettingsText ConfirmDelete="Vil du slette denne bil?" />
                <SettingsBehavior ConfirmDelete="True" AllowGroup="true" AllowDragDrop="true" />
                <Columns>
                    <dxwgv:GridViewCommandColumn VisibleIndex="1">
                        <CustomButtons>
                            <dxwgv:GridViewCommandColumnCustomButton Text="Rediger" ID="EditCar" />
                        </CustomButtons>
                    </dxwgv:GridViewCommandColumn>
                   <%-- <dxwgv:GridViewDataColumn FieldName="SubscriptionId" Visible="false" VisibleIndex="4" Caption="SubscriptionId">
                    </dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="CustomerSubscriptionDescription" VisibleIndex="5" UnboundType="String" Caption="Abonnement">
                    </dxwgv:GridViewDataTextColumn>--%>
                    <dxwgv:GridViewDataColumn FieldName="RegistrationNumber" VisibleIndex="6" Caption="Reg.nr.">
                    </dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="BrandDescription" VisibleIndex="7" UnboundType="String" Caption="Bilmærke">
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataColumn FieldName="CarBrandId" VisibleIndex="7" Visible="false" Caption="CarBrandId">
                    </dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataColumn FieldName="Model" VisibleIndex="7" Caption="Model">
                    </dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataColumn FieldName="EngineSize" VisibleIndex="7" Caption="Motor">
                    </dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataColumn FieldName="FuelType" VisibleIndex="7" Caption="FuelType" Visible="false">
                    </dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataColumn FieldName="FuelTypeDescription" UnboundType="String" VisibleIndex="7" Caption="Brændstof">
                    </dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataColumn FieldName="Year" VisibleIndex="8" Caption="Årgang">
                    </dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataColumn FieldName="CarStatusDescription" VisibleIndex="9" UnboundType="String" Caption="Status">
                    </dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataColumn FieldName="CarStatusId" VisibleIndex="10" Visible="false" Caption="CarStatusId">
                    </dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataColumn FieldName="Createdate" VisibleIndex="12" Caption="Oprettelsesdato">
                    </dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataColumn FieldName="LastTireSetChangeDate" VisibleIndex="13" Caption="Sidst dækskift">
                    </dxwgv:GridViewDataColumn>
                </Columns>                                            
            </dxwgv:ASPxGridView>

            <asp:Panel ID="pCars" runat="server" Visible="false">
                <table border="0" cellspacing="0" cellpadding="5" width="400px">
                    <tr>
                        <td colspan="2">
                            <div style="font-family: Tahoma; font-size: 9pt; font-weight: normal; color: #f15e34">
                                &nbsp;<asp:Literal ID="lMessage" runat="server"></asp:Literal>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblRegistrationNumber" runat="server" Text="Registreringsnr."></asp:Label>
                        </td>
                        <td>
                            <dx:ASPxTextBox ID="txtRegistrationNumber" runat="server" Width="75px" ClientIDMode="AutoID" >
                                <MaskSettings Mask="aa00000" IncludeLiterals="DecimalSymbol" />
                                <ValidationSettings ValidationGroup="Step3" RequiredField-IsRequired="true" RequiredField-ErrorText="Udfyld registreringsnummer (Nummerplade)" ErrorDisplayMode="ImageWithTooltip" />
                            </dx:ASPxTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblCarBrandId" runat="server" Text="Bilmærke"></asp:Label>
                        </td>
                        <td>
                            <dx:ASPxComboBox ID="ddlCarBrand" runat="server" 
                                IncrementalFilteringMode="StartsWith" Width="175px" ClientIDMode="AutoID" 
                                EnableIncrementalFiltering="True" Spacing="0" ValueType="System.String">
                                <LoadingPanelStyle ImageSpacing="5px">
                                </LoadingPanelStyle>
                                <ValidationSettings ValidationGroup="Step3" RequiredField-IsRequired="true" RequiredField-ErrorText="Udfyld bilmærke">
                                    <RequiredField ErrorText="Udfyld bilmærke" IsRequired="True" />
                                </ValidationSettings>
                            </dx:ASPxComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblModel" runat="server" Text="Model"></asp:Label>
                        </td>
                        <td>
                            <dx:ASPxTextBox ID="txtModel" runat="server" Width="175px" ClientIDMode="AutoID" >
                                <ValidationSettings ValidationGroup="Step3" RequiredField-IsRequired="true" RequiredField-ErrorText="Udfyld bil model"></ValidationSettings>
                            </dx:ASPxTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblEngineSize" runat="server" Text="Motor"></asp:Label>
                        </td>
                        <td>
                            <dx:ASPxTextBox ID="txtEngineSize" runat="server" Width="175px" ClientIDMode="AutoID" >
                                <ValidationSettings ValidationGroup="Step3" RequiredField-IsRequired="true" RequiredField-ErrorText="Udfyld motorstørrelse - f.eks. 1.0"></ValidationSettings>
                            </dx:ASPxTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblFuelType" runat="server" Text="Brændstof"></asp:Label>
                        </td>
                        <td>
                            <dx:ASPxComboBox ID="ddlFuelType" runat="server" Width="100px" ClientIDMode="AutoID" Spacing="0" ValueType="System.String">
                                <ValidationSettings ValidationGroup="Step3" RequiredField-IsRequired="true" RequiredField-ErrorText="Vælg brændstoftype for bil"></ValidationSettings>
                                <Items>
                                    <dx:ListEditItem Value="0" Text="Benzin" />
                                    <dx:ListEditItem Value="1" Text="Diesel" />
                                </Items>
                                <LoadingPanelStyle ImageSpacing="5px">
                                </LoadingPanelStyle>
                            </dx:ASPxComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblColor" runat="server" Text="Farve"></asp:Label>
                        </td>
                        <td>
                            <dx:ASPxTextBox ID="txtColor" runat="server" Width="175px" ClientIDMode="AutoID" >
                                <ValidationSettings ValidationGroup="Step3" RequiredField-IsRequired="true" RequiredField-ErrorText="Udfyld farve på bil"></ValidationSettings>
                            </dx:ASPxTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblYear" runat="server" Text="Årgang"></asp:Label>
                        </td>
                        <td>
                            <dx:ASPxComboBox ID="txtYear" runat="server" Width="100px" ClientIDMode="AutoID" Spacing="0" ValueType="System.String">
                                <ValidationSettings RequiredField-IsRequired="true" RequiredField-ErrorText="Vælg brændstoftype for bil"></ValidationSettings>
                                <LoadingPanelStyle ImageSpacing="5px">
                                </LoadingPanelStyle>
                            </dx:ASPxComboBox>

                            <%--<dx:ASPxTextBox ID="txtYear" runat="server" ClientIDMode="AutoID" 
                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                CssPostfix="Office2010Blue" 
                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                <MaskSettings Mask="0000" />
                                <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-IsRequired="true" RequiredField-ErrorText="Udfyld bilens årgang" ValidationGroup="Step3" />
                            </dx:ASPxTextBox>--%>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Button ID="btnCancelEditCar" runat="server" Text="Annuller" OnClick="btnCancelEditCar_Click" />
                            &nbsp;
                            <asp:Button ID="btnSaveCar" runat="server" Text="Gem" OnClick="btnSaveCar_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
